package com.lx.controller;

import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.PasswordField;
import javafx.scene.control.TextField;

import java.net.URL;
import java.util.ResourceBundle;

public class IndexController implements Initializable {

    @FXML private TextField user;
    @FXML private PasswordField password;

    //登录界面
    @FXML
    private MainApp mainApp;
    @FXML
    public TextField textField;
    @FXML
    public Label label;

    @FXML
    public Button button;

    @FXML
    public void hanldeButtonAction(ActionEvent event) {
        label.setText("文本框输入内容为:" + textField.getText());
    }

    @Override
    public void initialize(URL url, ResourceBundle resourceBundle) {
        // 在窗体构建后，调用该方法
    }

    //调用登录界面
    public void setApp(MainApp mainApp){
        this.mainApp = mainApp;
    }
    @FXML
    public void LOGIN_M(ActionEvent event) {
        mainApp.userlogin(user.getText(), password.getText());
    }

    @FXML
    private void CLEAR_M(ActionEvent event) {
        user.setText(null);
        password.setText(null);
    }



}

